<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Clear bit</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.gmp-binomial.html">« gmp_binomial</a></li>
      <li style="float: right;"><a href="function.gmp-cmp.html">gmp_cmp »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.gmp.html">GMP 函数</a></li>
    <li>Clear bit</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.gmp-clrbit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmp_clrbit</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gmp_clrbit</span> &mdash; <span class="dc-title">Clear bit</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.gmp-clrbit-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_clrbit</strong></span>(<span class="methodparam"><span class="type"><a href="class.gmp.html" class="type GMP">GMP</a></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$index</code></span>): <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
   Clears (sets to 0) bit <code class="parameter">index</code> in
   <code class="parameter">num</code>. The index starts at 0.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmp-clrbit-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">num</code></dt>

     <dd>

      <p class="para"><span class="classname"><a href="class.gmp.html" class="classname">GMP</a></span> 对象或 <span class="type">int</span> ，或数字<span class="type">string</span>。</p> 
     </dd>

    
    
     <dt>
<code class="parameter">index</code></dt>

     <dd>

      <p class="para">
       The index of the bit to clear.  Index 0 represents the least significant bit.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmp-clrbit-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   <span class="classname"><a href="class.gmp.html" class="classname">GMP</a></span> 对象。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmp-clrbit-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-3037">
   <p><strong>示例 #1 <span class="function"><strong>gmp_clrbit()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"0xff"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">gmp_clrbit</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;index&nbsp;starts&nbsp;at&nbsp;0,&nbsp;least&nbsp;significant&nbsp;bit<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">gmp_strval</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
254
</pre></div>
   </div>
  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-function.gmp-clrbit-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    Unlike most of the other GMP functions, <span class="function"><strong>gmp_clrbit()</strong></span>
    must be called with a GMP object that already exists (using
    <span class="function"><a href="function.gmp-init.html" class="function">gmp_init()</a></span> for example). One will not be
    automatically created.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.gmp-clrbit-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.gmp-setbit.html" class="function" rel="rdfs-seeAlso">gmp_setbit()</a> - Set bit</span></li>
    <li class="member"><span class="function"><a href="function.gmp-testbit.html" class="function" rel="rdfs-seeAlso">gmp_testbit()</a> - Tests if a bit is set</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>